<template>
     <div class="loader">
        <image src="http://zhongcai-test.oss-cn-beijing.aliyuncs.com/hch5/loding.png" class="loading-img" ref="loadingImg"></image>
    </div>
</template>

<script>
const animation = weex.requireModule('animation');
export default {
    data:()=>({
      current_rotate: 0
    }),
    methods:{
        //loading动画
        loading(el){
            let self=this;
            this.current_rotate+=360;
            animation.transition(el,{
                styles:{
                transform: 'rotate('+self.current_rotate+'deg)',
                transformOrigin: 'center center'
                },
                duration: 600, //ms
                timingFunction: 'ease',
                delay: 0 //ms
            });
        },
    },
    mounted(){
        let that = this;
        let el=this.$refs.loadingImg;
        setInterval(function(){
             that.loading(el);
        },500)
    }
}
</script>

<style>
.loader{
    padding-bottom:28px;
     padding-top:28px;
}
 .loading-img{
    width:34px;
    height:34px;
 
}
</style>
